package com.chenfan.mcn.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenfan.mcn.extension.log.FieldDesc;
import com.chenfan.mcn.constant.NumberFormatCst;
import com.chenfan.mcn.enums.PaidStatusEnum;
import com.chenfan.mcn.enums.StarMonthlySettlementStatusEnum;
import com.chenfan.mcn.extension.log.FieldTypeEnum;
import com.chenfan.mcn.component.dict.StarAccountInfoIdTranslator;
import com.chenfan.mcn.model.base.BaseOwnerEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 红人月度结算单
 * </p>
 *
 * @author wulg
 * @since 2022-01-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("star_monthly_settlement")
public class StarMonthlySettlement extends BaseOwnerEntity {

    /**
     * 结算单号
     */
    @TableField("settlement_code")
    private String settlementCode;

    /**
     * 单据状态：0_待提交、1_审批中、2_待打款、3_审批拒绝、4_已撤回、5_部分打款、6_已打款、9_已作废
     */
    @FieldDesc(value ="单据状态", translator = StarMonthlySettlementStatusEnum.class)
    @TableField("approval_status")
    private Integer approvalStatus;

    /**
     * 线上打款状态：0_待打款、1_部分打款、2_已打款
     */
    @FieldDesc(value ="线上打款状态", translator = PaidStatusEnum.class)
    @TableField("online_paid_status")
    private Integer onlinePaidStatus;

    /**
     * 线下打款状态：0_待打款、1_部分打款、2_已打款
     */
    @FieldDesc(value ="线下打款状态", translator = PaidStatusEnum.class)
    @TableField("offline_paid_status")
    private Integer offlinePaidStatus;

    /**
     * 红人ID
     */
    @TableField("star_id")
    private Long starId;

    /**
     * 信息确认截图
     */
    @FieldDesc(value ="信息确认截图", fieldType = FieldTypeEnum.IMAGE)
    @TableField("confirm_screenshot")
    private String confirmScreenshot;

    /**
     * 附件
     */
    @FieldDesc(value ="附件", fieldType = FieldTypeEnum.FILE)
    @TableField("attachment_file")
    private String attachmentFile;

    /**
     * 结算时间（精确到月）
     */
    @JSONField(format = "yyyy-MM")
    @FieldDesc(value ="结算时间", format = "yyyy-MM")
    @TableField("settlement_date")
    private Date settlementDate;

    /**
     * 是否线下报销：0否1是
     */
    @FieldDesc(value ="是否线下报销", replace = {"否_0","是_1"})
    @TableField("is_offline_reimburse")
    private Integer isOfflineReimburse;

    /**
     * 备注
     */
    @FieldDesc(value ="备注")
    @TableField("remark")
    private String remark;

    /**
     * 红人收款账户ID
     */
    @FieldDesc(value ="收款户名", translator = StarAccountInfoIdTranslator.class)
    @TableField("star_account_id")
    private Long starAccountId;

    /**
     * 最近打款回调日期
     */
    @FieldDesc(value ="最近打款回调日期", format = "yyyy-MM-dd")
    @TableField("payback_date")
    private Date paybackDate;

    /**
     * 累计打款金额
     */
    @FieldDesc(value ="累计打款金额", format = NumberFormatCst.AMOUNT)
    @TableField("payback_amount")
    private BigDecimal paybackAmount;
}
